import { createRouter, createWebHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'
import MockList from '../views/MockList.vue'
import MockDetail from '../views/MockDetail.vue'
import MockCreate from '../views/MockCreate.vue'
import MockEdit from '../views/MockEdit.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'MockList',
    component: MockList
  },
  {
    path: '/mock/:id',
    name: 'MockDetail',
    component: MockDetail
  },
  {
    path: '/create',
    name: 'MockCreate',
    component: MockCreate
  },
  {
    path: '/edit/:id',
    name: 'MockEdit',
    component: MockEdit
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router